package top.hjcwzx.wrench.limiter.strategy.key.impl;

import top.hjcwzx.wrench.limiter.strategy.key.RateLimiterKeyStrategy;
import top.hjcwzx.wrench.limiter.utils.SpELUtil;

import java.lang.reflect.Method;

// spel表达式解析key
public class SpelKeyStrategy implements RateLimiterKeyStrategy {
    @Override
    public String generateKey(Method method, Object[] args, Object target, String keyExpr) {
        return SpELUtil.parse(keyExpr, method, args);
    }
}
